package org.agbe;

import org.apache.cordova.DroidGap;

import android.webkit.WebView;

public class AgbeNativeInterface {

	MediaPlayerPool playerPool;

	@SuppressWarnings("unused")
	private final WebView mAppView;
	private final DroidGap mGap;

	public AgbeNativeInterface(DroidGap gap, WebView view) {
		mAppView = view;
		mGap = gap;
	}

	public void stopSounds() {
		playerPool.stopAllSounds();
	}

	public void pauseSounds() {
		playerPool.pauseAllSounds();
	}

	public void resumeSounds() {
		playerPool.resumeAllSounds();
	}

	public void playSound(String soundfilePath, int iteration) {
		playerPool.playSound(soundfilePath, iteration);
	}

	public void init() {
		playerPool = new MediaPlayerPool(mGap);
		playerPool.init();
	}

	public void onPause() {
		pauseSounds();
	}

	public void onResume() {
		resumeSounds();
	}

}